package BLL;

import DAL.LogDao;
import DAL.OperatorDao;
import Entity.Operator;

import java.util.Date;
import java.util.List;

/**
 * 管理操作员
 * @Author Chen
 * @Date 2022/1/6 19:25
 * @Version 1.0
 */
public class Personnel {
    static LogDao ld=new LogDao();
    static OperatorDao op=new OperatorDao();
    //操作员信息添加
    public static int addPersonnel(Object... args){
        int i = op.addOperator(args);
        Date date=new Date();
        String s="操作员信息添加！";
        ld.insertloginLog(date,s);
        return i;
    }

    //操作员信息查看
    public static List<Operator> lookPersonnel(){
        List<Operator> operators = op.selectOperator();
        Date date=new Date();
        String s="操作员信息查看！";
        ld.insertloginLog(date,s);
        return operators;
    }

    //操作员信息修改
    public static int updatePersonnel(Object... args){
        int i = op.updateOperator(args);
        Date date=new Date();
        String s="操作员信息修改！";
        ld.insertloginLog(date,s);
        return i;
    }

    //操作员信息删除
    public static int deletePersonnel(Object... args){
        int i = op.deleteOperator(args);
        Date date=new Date();
        String s="操作员信息删除！";
        ld.insertloginLog(date,s);
        return i;
    }
    //操作员信息查找（账号）
    public static Operator selectaccoundNumber(Object... args){
        Operator operator = op.selectBYOperator(args);
        Date date=new Date();
        String s="操作员信息查找（账号）！";
        ld.insertloginLog(date,s);
        return operator;
    }
}
